package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.math.BigDecimal;
import java.util.List;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import com.tool.btn.ImpactGradeGoodsBtn;
import org.come.Frame.ImpactGradeJframe;
import org.come.Frame.ZhuFrame;
import org.come.bean.ChongjipackBean;
import org.come.bean.LoginResult;
import org.come.bean.XXGDBean;
import org.come.entity.Goodstable;
import org.come.mouslisten.VipGoodsMouselistener;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.summonequip.MouseListenerCashRewards;
import org.come.until.*;

import com.tool.btn.VipShopBtn;
import com.tool.role.RoleData;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;

public class ImpactGradeGoodsJpanel extends JPanel {

    private JLabel[] goodsImgs;
    private JLabel[] goodsNums;
    private JLabel[] goodsNums1;
    private VipGoodsMouselistener[] mouselistener;
    private VipShopBtn getBtn;
    private ImpactGradeGoodsBtn b1, b2;
    /**
     * 充值条件nameRich<br>
     * 返还金额moneyRich<br>
     *
     */
    private RichLabel nameRich, moneyRich,moneyRichLQ;

    private ChongjipackBean chongjipackBean;

    /** 领取的总数量 */
    private int numMax;

    public ImpactGradeGoodsJpanel() {
        setPreferredSize(new Dimension(477, 57));
        setOpaque(false);
        setLayout(null);
        b1 = new ImpactGradeGoodsBtn("inkImg/newbutton/156.png", 1, 1, "", this);
        b1.setBounds(104, 15, 18, 25);
        b1.setVisible(false);
        this.add(b1);
        b2 = new ImpactGradeGoodsBtn("inkImg/newbutton/155.png", 1, 2, "", this);
        b2.setBounds(375, 15, 18, 25);
        b2.setVisible(false);
        this.add(b2);
        getGetBtn();
        getNameRich();
        getMoneyRich();
        getMoneyRichLQ();
        getGoodsNums();
        getGoodsImgs();
        getGoodsNums1();
    }

    /**
     * (packgrade 1 代表免费， 2 代表小资，3 代表土豪；number 为对应的领取等级 礼包序号为 1-10)
     */
    public void exchangeGoods() {
        if (chongjipackBean == null)
            return;
        List<XXGDBean> goods = ChongjipackBean.getGoodsImpactGrade(chongjipackBean.getPackgoods());
        int x = 0;
        for (XXGDBean good : goods) {
            Goodstable goodstable = UserMessUntil.getgoodstable(good.getId());
            if(goodstable == null) {
                continue;
            }
            if (!EquipTool.isEquip(goodstable.getType())){
                x++;
            }else{
                x = x + good.getSum();
            }
        }
//        if (GoodsListFromServerUntil.Surplussum("-1", "-1", numMax) < numMax) {
//            ZhuFrame.getZhuJpanel().addPrompt2("你的背包不够");
//            return;
//        }
        String sendmes = "";
        if (chongjipackBean.getPacktype() == 4) {
            sendmes = Agreement.getAgreement().PaydaygradesureAgreement("v" + chongjipackBean.getPackgradetype());
        } else if (chongjipackBean.getPacktype() == 5) {
            sendmes = Agreement.getAgreement().DayforweekgradesureAgreement("v" + chongjipackBean.getPackgradetype());
        } else if (chongjipackBean.getPacktype() == 7) {
            sendmes = Agreement.getAgreement().PayLJgradesureAgreement("v" + chongjipackBean.getPackgradetype());
        } else
            sendmes = Agreement.getAgreement().ChongjipacksureAgreement(
                    chongjipackBean.getPacktype() + "|" + chongjipackBean.getPackgradetype());
        SendMessageUntil.toServer(sendmes);
    }

    public void showGoods(ChongjipackBean bean) {
        this.chongjipackBean = bean;
        b1.setVisible(false);
        b2.setVisible(false);
        if (bean != null) {
            List<XXGDBean> goods = ChongjipackBean.getGoodsImpactGrade(bean.getPackgoods());
            LoginResult loginResult = RoleData.getRoleData().getLoginResult();
            int needlv = AnalysisString.lvldirection1(bean.getPackgrade());
            int level = loginResult.getGrade();
//            int level = getRoleGradeReward(loginResult.getGrade());
            int typeMenu = ImpactGradeJframe.getImpactGradeJframe().getImpactGradeJpanel().getTypeMenu();
            if (level >= needlv) {
                int lvl = -1;
                if (typeMenu == 1) {
                    lvl = 4;
                } else if ((typeMenu - 1) == loginResult.getLowOrHihtpack()) {
                    lvl = 5;
                }
                if (lvl != -1) {
                    String[] split = null;
                    if (loginResult.getVipget() != null) {
                        split = loginResult.getVipget().split("&&");
                    }
                    if (checkYesOrNo(split, lvl + "", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    } else {
                        moneyRichLQ.setText("");
                        moneyRich.setVisible(false);
                    }
                } else {
                    moneyRich.setText("#c784023暂不可领取");
                    moneyRich.setVisible(false);
//                moneyRich.setText("#G已领取");
                }
            } else {
                moneyRich.setText("#c784023等级未达到");
                moneyRich.setVisible(true);
//                moneyRich.setText("#G已领取");
            }
            goodsImgsClear();
            numMax = 0;
            int size = 0;
            if (goods.size() > 6) {
                size = 6;
                b2.setVisible(true);
            } else
                size = goods.size();
            for (int i = 0; i < size; i++) {
                Goodstable goodstable = UserMessUntil.getgoodstable(goods.get(i).getId());
                goodsNums[i].setVisible(true);
                goodsNums[i].setText(goods.get(i).getSum() + "");//显示物品数量
                goodsImgs[i].setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 40, 40));
                mouselistener[i].setGoodstable(goodstable);//冲级礼包增加说明
                numMax += goods.get(i).getSum();
                goodsNums1[i].setVisible(true);
                goodsNums1[i].setText(goods.get(i).getSum() + "");//显示物品数量
            }
            changeName("#c580404"+bean.getPackgrade() + "级");
        }
    }
    public void refreshItem(int caozuo) {
        b1.setVisible(false);

        ChongjipackBean bean = chongjipackBean;
        if (bean != null) {
            List<XXGDBean> goods = ChongjipackBean.getGoodsImpactGrade(bean.getPackgoods());
            int index = this.getB2().getI();
            if (caozuo == 1) {
                index -= 1;
                if (index < 0) {
                    index = 0;
                }
            } else if (caozuo == 2) {
                index += 1;
            }
            if (index != 0)
                b1.setVisible(true);
            if (index + 6 > goods.size()) {
                ZhuFrame.getZhuJpanel().addPrompt("没有更多了#76");
                return;
            }
            getB2().setI(index);

            LoginResult loginResult = RoleData.getRoleData().getLoginResult();
            int needlv = AnalysisString.lvldirection1(bean.getPackgrade());
            int level = loginResult.getGrade();
//            int level = getRoleGradeReward(loginResult.getGrade());
            int typeMenu = ImpactGradeJframe.getImpactGradeJframe().getImpactGradeJpanel().getTypeMenu();
            if (level >= needlv) {
                int lvl = -1;
                if (typeMenu == 1) {
                    lvl = 4;
                } else if ((typeMenu - 1) == loginResult.getLowOrHihtpack()) {
                    lvl = 5;
                }
                if (lvl != -1) {
                    String[] split = null;
                    if (loginResult.getVipget() != null) {
                        split = loginResult.getVipget().split("&&");
                    }

                    if (checkYesOrNo(split, lvl + "", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    } else {
                        moneyRichLQ.setText("");
                    }
                } else {
                    moneyRich.setText("#c784023暂不可领取");
                }
            } else {
                moneyRich.setText("#c784023等级未达到");
                moneyRich.setVisible(true);

            }
            goodsImgsClear();
            numMax = 0;
//            for (int i = 0; i < goods.size(); i++) {
            int size = 0;
            if (goods.size() > 6) {
                size = 6;
                b2.setVisible(true);
            } else
                size = goods.size();
            int j = 0;
            for (int i = 0; i < goodsNums.length; i++) {
                goodsNums[i].setVisible(false);
                goodsImgs[i].setVisible(false);
                goodsNums1[i].setVisible(false);
            }
            for (int i = index; i < index + 6; i++) {
                Goodstable goodstable = UserMessUntil.getgoodstable(goods.get(i).getId());
                goodsNums[j].setVisible(true);
                goodsNums[j].setText(goods.get(i).getSum() + "");//显示物品数量
                goodsImgs[j].setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 40, 40));
                mouselistener[j].setGoodstable(goodstable);//冲级礼包增加说明
                numMax += 1;
                goodsNums1[j].setVisible(true);
                goodsNums1[j].setText(goods.get(i).getSum() + "");
                goodsImgs[j].setVisible(true);//显示物品数量
                j++;
            }
            changeName("#c580404"+bean.getPackgrade() + "级");
        }
    }
    private String getLiBaoType(ChongjipackBean chongjipackBean) {
        if (chongjipackBean.getPacktype() == 1) {
            return "4";
        }
        if (chongjipackBean.getPacktype() == 2 || chongjipackBean.getPacktype() == 3) {
            return "5";
        } else if (chongjipackBean.getPacktype() == 4) {
            return "2";
        } else if (chongjipackBean.getPacktype() == 5) {
            return "3";
        } else if (chongjipackBean.getPacktype() == 7) {
            return "7";
        }
        return "";

    }
    public void showGoods1(ChongjipackBean bean) {
        LoginResult loginResult1 = RoleData.getRoleData().getLoginResult();
        this.chongjipackBean = bean;
        b1.setVisible(false);
        b2.setVisible(false);
        if (bean != null) {
            List<XXGDBean> goods = ChongjipackBean.getGoodsImpactGrade(bean.getPackgoods());
            LoginResult loginResult = RoleData.getRoleData().getLoginResult();

            String[] split = null;
            if (loginResult.getVipget() != null) {
                split = loginResult.getVipget().split("&&");
            }
            BigDecimal daypaysum = loginResult.getDaypaysum();// 日累计充值
            BigDecimal dayandpayorno = loginResult.getDayandpayorno();// 连续充值数
            BigDecimal paysum = loginResult.getPaysum();// 累计充值
            if (bean.getPacktype() == 4) {
                if (daypaysum.doubleValue() > chongjipackBean.getCanpaymoney()) {
                    if (checkYesOrNo(split, "2", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    }else{
                        moneyRichLQ.setText("");
                    }
                } else {
                    moneyRich.setText("#c784023金额未达到");
                    moneyRich.setVisible(true);
                }
            }else if (bean.getPacktype() == 5) {
                if (dayandpayorno.compareTo(BigDecimal.valueOf(chongjipackBean.getPackgradetype())) >= 0) {
                    if (checkYesOrNo(split, "3", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    }else{
                        moneyRichLQ.setText("");
                    }
                } else {
                    moneyRich.setText("#c784023天数未达到");
                    moneyRich.setVisible(true);
                }
            }else if (bean.getPacktype() == 7) {
                if (paysum.doubleValue() >= chongjipackBean.getCanpaymoney()) {
                    if (checkYesOrNo(split, "7", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    }else{
                        moneyRichLQ.setText("");
                    }
                } else {
                    moneyRich.setText("#c784023金额未达到");
                    moneyRich.setVisible(true);
                }
            }

            goodsImgsClear();
            numMax = 0;

            int size = 0;
            if (goods.size() > 6) {
                size = 6;
                b2.setVisible(true);
            } else
                size = goods.size();
            for (int i = 0; i < size; i++) {
                Goodstable goodstable = UserMessUntil.getgoodstable(goods.get(i).getId());
                if(goodstable == null)
                    continue;
                goodsNums[i].setVisible(true);
                goodsNums[i].setText(goods.get(i).getSum() + "");//显示物品数量
                goodsImgs[i].setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 40, 40));
                mouselistener[i].setGoodstable(goodstable);//冲级礼包增加说明
                numMax += 1;
                goodsNums1[i].setVisible(true);
                goodsNums1[i].setText(goods.get(i).getSum() + "");//显示物品数量
            }
            if (bean.getPacktype() == 4) {
                changeName("#c580404累计" + bean.getCanpaymoney() + "元");
            } else if (bean.getPacktype() == 5) {
                changeName("#c580404连冲" + bean.getPackgradetype() + "天");
            } else if (bean.getPacktype() == 7) {
                changeName("#c580404累计" + bean.getCanpaymoney() + "元");
            }
        }
    }

    public void refreshItem1(int caozuo) {
        b1.setVisible(false);

        ChongjipackBean bean = chongjipackBean;
        if (bean != null) {
            List<XXGDBean> goods = ChongjipackBean.getGoodsImpactGrade(bean.getPackgoods());
            int index = this.getB2().getI();
            if (caozuo == 1) {
                index -= 1;
                if (index < 0) {
                    index = 0;
                }
            } else if (caozuo == 2) {
                index += 1;
            }
            if (index != 0)
                b1.setVisible(true);
            if (index + 6 > goods.size()) {
                ZhuFrame.getZhuJpanel().addPrompt("没有更多了#76");
                return;
            }
            getB2().setI(index);
            LoginResult loginResult = RoleData.getRoleData().getLoginResult();
            String[] split = null;
            if (loginResult.getVipget() != null) {
                split = loginResult.getVipget().split("&&");
            }
            BigDecimal daypaysum = loginResult.getDaypaysum();// 日累计充值
            BigDecimal dayandpayorno = loginResult.getDayandpayorno();// 连续充值数
            BigDecimal paysum = loginResult.getPaysum();// 累计充值
            if (bean.getPacktype() == 4) {
                if (daypaysum.doubleValue() >= chongjipackBean.getCanpaymoney()) {
                    if (checkYesOrNo(split, "2", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    }
                } else {
                    moneyRich.setText("#c784023金额未达到");
                    moneyRich.setVisible(true);
                }
            }else if (bean.getPacktype() == 5) {
                if (dayandpayorno.compareTo(BigDecimal.valueOf(chongjipackBean.getPackgradetype())) >= 0 && daypaysum.doubleValue() >= bean.getCanpaymoney()) {
                    if (checkYesOrNo(split, "3", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    }
                } else {
                    moneyRich.setText("#c784023天数未达到");
                    moneyRich.setVisible(true);
                }
            }else if (bean.getPacktype() == 7) {
                if (paysum.doubleValue() >= chongjipackBean.getCanpaymoney()) {
                    if (checkYesOrNo(split, "7", bean.getPackgradetype() + "")) {
                        moneyRichLQ.setText("#c784023  已领取");
                        moneyRichLQ.setVisible(true);
                        moneyRich.setVisible(false);
                    } else {
                        moneyRichLQ.setText("");
                    }
                } else {
                    moneyRich.setText("#c784023金额未达到");
                    moneyRich.setVisible(true);
                }
            }
            goodsImgsClear();
            numMax = 0;
//            for (int i = 0; i < goods.size(); i++) {
            int size = 0;
            if (goods.size() > 6) {
                size = 6;
                b2.setVisible(true);
            } else
                size = goods.size();
            int j = 0;
            for (int i = 0; i < goodsNums.length; i++) {
                goodsNums[i].setVisible(false);
                goodsImgs[i].setVisible(false);
                goodsNums1[i].setVisible(false);
            }
            for (int i = index; i < index + 6; i++) {
                Goodstable goodstable = UserMessUntil.getgoodstable(goods.get(i).getId());
                goodsNums[j].setVisible(true);
                goodsNums[j].setText(goods.get(i).getSum() + "");//显示物品数量
                goodsImgs[j].setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 40, 40));
                mouselistener[j].setGoodstable(goodstable);//冲级礼包增加说明
                numMax += 1;
                goodsNums1[j].setVisible(true);
                goodsNums1[j].setText(goods.get(i).getSum() + "");
                goodsImgs[j].setVisible(true);//显示物品数量
//
//                goodsNums[i].setBounds(170 + j * 42, 6, 16, 16);
//                goodsImgs[i].setBounds(146 + j * 42, 8, 40, 40);
//                goodsNums1[i].setBounds(146 + j * 42, 8, 40, 40);
                j++;
            }
            if (bean.getPacktype() == 4) {
                changeName("#c580404累计" + bean.getCanpaymoney() + "元");
            } else if (bean.getPacktype() == 5) {
                changeName("#c580404连冲" + bean.getPackgradetype() + "天");
            } else if (bean.getPacktype() == 7) {
                changeName("#c580404累计" + bean.getCanpaymoney() + "元");
            }
        }
    }

    public void goodsImgsClear() {
        for (int i = 0; i < goodsImgs.length; i++) {
            goodsNums[i].setText("");
            goodsNums[i].setVisible(false);
            goodsImgs[i].setIcon(null);
            goodsNums1[i].setText("");
            goodsNums1[i].setVisible(false);
        }
    }

    /**
     * 判断是否已领取对应奖励
     *
     * @param action
     *            操作类型 (1=表示 vip特权,2=表示每日充值领取等级包,3=表示连续充值,4=表示免费冲级礼包,5=表示小资或者土豪)
     * @param grade
     *            奖励等级 (1,2,3,...)
     * @return false 未领取 / true 已领取
     */
    public static boolean checkYesOrNo(String[] infoArr, String action, String grade) {
        if (infoArr == null) {
            return false;
        }
        // 遍历
        // 根据 = 切割获得 ( [0]操作类型 , [1]奖励等级集合 )
        action+="=";
        for (int i = 0; i < infoArr.length; i++) {
            if (infoArr[i].startsWith(action)) {
                String[] arr = infoArr[i].split("=");
                if (arr.length == 1) {
                    return false;
                }
                String[] gradeArr = arr[1].split("\\|");
                for (int j = 0; j < gradeArr.length; j++) {
                    if (gradeArr[j].equals(grade)) {
                        return true;
                    }
                }
            }
//            if (arr[0].equals(action)) {
//                if (arr.length == 1) {
//                    // 还未领取过奖励
//                    return false;
//                } else {
//                    // 获得已领取的奖励集合 (根据 | 切割)
//                    String[] gradeArr = arr[1].split("\\|");
//                    for (int j = 0; j < gradeArr.length; j++) {
//                        if (gradeArr[j].equals(grade)) {
//                            return true;
//                        }
//                    }
//                }
//            }
        }
        return false;
    }

    /**
     * 根据等级获取奖励等级
     *
     * @param grade
     * @return
     */
    public static int getRoleGradeReward(int grade) {
        if (grade >= 439) {
            return 15;
        }else if (grade >= 379) {
            return 14;
        }else if (grade >= 336) {
            return 13;
        }else if (grade >= 296) {
            return 12;
        }else if (grade >= 210) {
            return 11;
        }else if (grade >= 188) {
            return 10;
        } else if (grade >= 158) {
            return 9;
        } else if (grade >= 103) {
            return 8;
        } else if (grade >= 100) {
            return 7;
        } else if (grade >= 90) {
            return 6;
        } else if (grade >= 80) {
            return 5;
        } else if (grade >= 70) {
            return 4;
        } else if (grade >= 50) {
            return 3;
        } else if (grade >= 30 ) {
            return 2;
        } else if (grade >= 0 ) {
            return 1;
        }
        return 0;
    }

    /**
     * 修改条件
     *
     * @param text
     */
    public void changeName(String text) {
//        nameRich = new RichLabel(text, UIUtils.TEXT_FONT1);
        nameRich.setText(text);
        Dimension d = nameRich.computeSize(136);
        nameRich.setSize(d);
        nameRich.setPreferredSize(d);
    }

    private ImageIcon iconBack;
    @Override
    protected void paintComponent(Graphics g) {
        // TODO Auto-generated method stub
        super.paintComponent(g);

        if (iconBack == null) {
            iconBack = CutButtonImage.getImage("inkImg/newbackground/B327.png", -1, -1);
        }
        g.drawImage(iconBack.getImage(), 0, 0, 477, 57, this);
    }

    public JLabel[] getGoodsImgs() {
        if (goodsImgs == null) {
            goodsImgs = new JLabel[9];
            mouselistener = new VipGoodsMouselistener[9];
            for (int i = 0; i < goodsImgs.length; i++) {
                goodsImgs[i] = new JLabel();
                mouselistener[i] = new VipGoodsMouselistener();
                goodsImgs[i].setBounds(124 + i * 42, 8, 40, 40);
                goodsImgs[i].addMouseListener(mouselistener[i]);
                this.add(goodsImgs[i]);
            }
        }
        return goodsImgs;
    }

    public void setGoodsImgs(JLabel[] goodsImgs) {
        this.goodsImgs = goodsImgs;
    }

    public JLabel[] getGoodsNums1() {
        if (goodsNums1 == null) {
            goodsNums1 = new JLabel[9];
            for (int i = 0; i < goodsNums1.length; i++) {
                goodsNums1[i] = new JLabel();
                goodsNums1[i].setBounds(124 + i * 42, 8, 40, 40);
                goodsNums1[i].setIcon(CutButtonImage.getImage("inkImg/newbackground/B326.png", -1, -1));
//                goodsNums1[i].setVerticalTextPosition(SwingConstants.CENTER);
//                goodsNums1[i].setHorizontalTextPosition(SwingConstants.CENTER);
//                goodsNums1[i].setForeground(Color.GREEN);
//                goodsNums1[i].setFont(UIUtils.TEXT_FONT10);
                this.add(goodsNums1[i]);
            }
        }
        return goodsNums1;
    }

    public void setGoodsNums1(JLabel[] goodsNums1) {
        this.goodsNums1 = goodsNums1;
    }
    public JLabel[] getGoodsNums() {
        if (goodsNums == null) {
            goodsNums = new JLabel[9];
            for (int i = 0; i < goodsNums.length; i++) {
                goodsNums[i] = new JLabel();
                goodsNums[i].setBounds(124 + i * 42, 6, 20, 16);
//                goodsNums[i].setIcon(CutButtonImage.getImage("inkImg/background/S24.png", -1, -1));
                goodsNums[i].setVerticalTextPosition(SwingConstants.CENTER);
                goodsNums[i].setHorizontalTextPosition(SwingConstants.CENTER);
                goodsNums[i].setForeground(Color.white);
                goodsNums[i].setFont(UIUtils.TEXT_FONT11);
                this.add(goodsNums[i]);
            }
        }
        return goodsNums;
    }

    public void setGoodsNums(JLabel[] goodsNums) {
        this.goodsNums = goodsNums;
    }
    public VipShopBtn getGetBtn() {
        if (getBtn == null) {
            getBtn = new VipShopBtn("inkImg/newbutton/K93.png", 1, 8, this);
            getBtn.setBounds(380, 5, 85, 32);
            getBtn.setVisible(false);
            this.add(getBtn);
        }
        return getBtn;
    }

    public void setGetBtn(VipShopBtn getBtn) {
        this.getBtn = getBtn;
    }

    public RichLabel getNameRich() {
        if (nameRich == null) {
            nameRich = new RichLabel("1级奖励", UIUtils.TEXT_FONT15);
            Dimension d = nameRich.computeSize(136);
            nameRich.setSize(d);
            nameRich.setPreferredSize(d);
            nameRich.setBounds(30, 16, 136, 20);
            this.add(nameRich);
        }
        return nameRich;
    }

    public void setNameRich(RichLabel nameRich) {
        this.nameRich = nameRich;
    }

    public RichLabel getMoneyRich() {
        if (moneyRich == null) {
            moneyRich = new RichLabel("", UIUtils.TXT_hyxk16);
            Dimension d = moneyRich.computeSize(136);
            moneyRich.setSize(d);
            moneyRich.setPreferredSize(d);
            moneyRich.setBounds(379, 29, 136, 30);
            moneyRich.setVisible(false);
            this.add(moneyRich);
        }
        return moneyRich;
    }

    public void setMoneyRich(RichLabel moneyRich) {
        this.moneyRich = moneyRich;
    }

    public RichLabel getMoneyRichLQ() {
        if (moneyRichLQ == null) {
            moneyRichLQ = new RichLabel("", UIUtils.TXT_hyxk16);
            Dimension d = moneyRichLQ.computeSize(136);
            moneyRichLQ.setSize(d);
            moneyRichLQ.setPreferredSize(d);
            moneyRichLQ.setBounds(380, 13, 136, 30);
            moneyRichLQ.setVisible(false);
            this.add(moneyRichLQ);
        }
        return moneyRichLQ;
    }

    public void setMoneyRichLQ(RichLabel moneyRich) {
        this.moneyRichLQ = moneyRichLQ;
    }

    public ImageIcon getIconBack() {
        return iconBack;
    }

    public void setIconBack(ImageIcon iconBack) {
        this.iconBack = iconBack;
    }

    public ChongjipackBean getChongjipackBean() {
        return chongjipackBean;
    }

    public void setChongjipackBean(ChongjipackBean chongjipackBean) {
        this.chongjipackBean = chongjipackBean;
    }

    public VipGoodsMouselistener[] getMouselistener() {
        return mouselistener;
    }

    public void setMouselistener(VipGoodsMouselistener[] mouselistener) {
        this.mouselistener = mouselistener;
    }

    public int getNumMax() {
        return numMax;
    }

    public void setNumMax(int numMax) {
        this.numMax = numMax;
    }
    public ImpactGradeGoodsBtn getB1() {
        return b1;
    }

    public void setB1(ImpactGradeGoodsBtn b1) {
        this.b1 = b1;
    }

    public ImpactGradeGoodsBtn getB2() {
        return b2;
    }

    public void setB2(ImpactGradeGoodsBtn b2) {
        this.b2 = b2;
    }
}
